{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 有用的'_'符号"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-11-18T09:42:45.923200Z",
     "start_time": "2021-11-18T09:42:45.911200Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "7"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "7"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x = 3\n",
    "y = 4\n",
    "x + y\n",
    "_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-11-18T09:43:42.806200Z",
     "start_time": "2021-11-18T09:43:42.798200Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'曲靖无线中心周三夜校'"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "'曲靖无线中心周三夜校'"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "name = '曲靖无线中心周三夜校'\n",
    "name\n",
    "_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-11-18T09:44:34.442200Z",
     "start_time": "2021-11-18T09:44:34.433200Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "7"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "曲靖无线中心周三夜校\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "7"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x + y\n",
    "print(\"曲靖无线中心周三夜校\")\n",
    "_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-11-18T10:00:44.567200Z",
     "start_time": "2021-11-18T10:00:44.559200Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "hello\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "7"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "class MyTest():\n",
    "    def __str__(self):\n",
    "        return \"hello\"\n",
    "    def __repr__(self):\n",
    "        return \"world\"\n",
    "\n",
    "mt = MyTest()\n",
    "print(mt)\n",
    "_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-11-18T10:00:55.893200Z",
     "start_time": "2021-11-18T10:00:55.882200Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "world"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "world"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mt\n",
    "_"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 格式化JSON字符串"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-11-18T10:05:42.926200Z",
     "start_time": "2021-11-18T10:05:42.915200Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'\"\\\\n{\\\\\"_id\\\\\":\\\\\"5f12d319624e57e27d1291fe\\\\\",\\\\\"index\\\\\":0,\\\\\"guid\\\\\":\\\\\"4e482708-c6aa-4ef9-a45e-d5c\\\\ne2c72c68d\\\\\",\\\\\"isActive\\\\\":false,\\\\\"balance\\\\\":\\\\\"$2,954.93\\\\\",\\\\\"picture\\\\\":\\\\\"http://placehold.i\\\\nt/32x32\\\\\",\\\\\"age\\\\\":36,\\\\\"eyeColor\\\\\":\\\\\"green\\\\\",\\\\\"name\\\\\":\\\\\"MasseySaunders\\\\\",\\\\\"gender\\\\\":\\\\\"male\\\\\",\\\\\"c\\\\nompany\\\\\":\\\\\"TALAE\\\\\",\\\\\"email\\\\\":\\\\\"masseysaunders@talae.com\\\\\",\\\\\"phone\\\\\":\\\\\"+1(853)508-3237\\\\\",\\\\\"a\\\\nddress\\\\\":\\\\\"246IndianaPlace,Glenbrook,Iowa,3896\\\\\",\\\\\"about\\\\\":\\\\\"Velitmagnanostrudexcepte\\\\nurduisextemporirurefugiataliquasunt.Excepteurvelitquiseuinexinoccaecatoccaecatv\\\\neliteuet.Commodonisialiquipirureminimconsequatminimconsecteturipsumsitex.\\\\r\\\\n\\\\\",\\\\n2.3 ?? json.tool ???? JSON\\\\n\\\\\"registered\\\\\":\\\\\"2017-02-06T06:42:20-08:00\\\\\",\\\\\"latitude\\\\\":-10.269827,\\\\\"longitude\\\\\":-103\\\\n.12419,\\\\\"tags\\\\\":[\\\\\"laborum\\\\\",\\\\\"excepteur\\\\\",\\\\\"veniam\\\\\",\\\\\"reprehenderit\\\\\",\\\\\"voluptate\\\\\",\\\\\"labo\\\\nrum\\\\\",\\\\\"in\\\\\"],\\\\\"friends\\\\\":[{\\\\\"id\\\\\":0,\\\\\"name\\\\\":\\\\\"DorotheaShields\\\\\"},{\\\\\"id\\\\\":1,\\\\\"name\\\\\":\\\\\"AnnaRos\\\\nales\\\\\"},{\\\\\"id\\\\\":2,\\\\\"name\\\\\":\\\\\"GravesBryant\\\\\"}],\\\\\"greeting\\\\\":\\\\\"Hello,MasseySaunders!Youhave\\\\n8unreadmessages.\\\\\",\\\\\"favoriteFruit\\\\\":\\\\\"apple\\\\\"}\\\\n\"'"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "json_str = '''\n",
    "{\"_id\":\"5f12d319624e57e27d1291fe\",\"index\":0,\"guid\":\"4e482708-c6aa-4ef9-a45e-d5c\n",
    "e2c72c68d\",\"isActive\":false,\"balance\":\"$2,954.93\",\"picture\":\"http://placehold.i\n",
    "t/32x32\",\"age\":36,\"eyeColor\":\"green\",\"name\":\"MasseySaunders\",\"gender\":\"male\",\"c\n",
    "ompany\":\"TALAE\",\"email\":\"masseysaunders@talae.com\",\"phone\":\"+1(853)508-3237\",\"a\n",
    "ddress\":\"246IndianaPlace,Glenbrook,Iowa,3896\",\"about\":\"Velitmagnanostrudexcepte\n",
    "urduisextemporirurefugiataliquasunt.Excepteurvelitquiseuinexinoccaecatoccaecatv\n",
    "eliteuet.Commodonisialiquipirureminimconsequatminimconsecteturipsumsitex.\\r\\n\",\n",
    "2.3 ?? json.tool ???? JSON\n",
    "\"registered\":\"2017-02-06T06:42:20-08:00\",\"latitude\":-10.269827,\"longitude\":-103\n",
    ".12419,\"tags\":[\"laborum\",\"excepteur\",\"veniam\",\"reprehenderit\",\"voluptate\",\"labo\n",
    "rum\",\"in\"],\"friends\":[{\"id\":0,\"name\":\"DorotheaShields\"},{\"id\":1,\"name\":\"AnnaRos\n",
    "ales\"},{\"id\":2,\"name\":\"GravesBryant\"}],\"greeting\":\"Hello,MasseySaunders!Youhave\n",
    "8unreadmessages.\",\"favoriteFruit\":\"apple\"}\n",
    "'''\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.0"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": true
  },
  "varInspector": {
   "cols": {
    "lenName": 16,
    "lenType": 16,
    "lenVar": 40
   },
   "kernels_config": {
    "python": {
     "delete_cmd_postfix": "",
     "delete_cmd_prefix": "del ",
     "library": "var_list.py",
     "varRefreshCmd": "print(var_dic_list())"
    },
    "r": {
     "delete_cmd_postfix": ") ",
     "delete_cmd_prefix": "rm(",
     "library": "var_list.r",
     "varRefreshCmd": "cat(var_dic_list()) "
    }
   },
   "types_to_exclude": [
    "module",
    "function",
    "builtin_function_or_method",
    "instance",
    "_Feature"
   ],
   "window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
